package br.com.fidalgotecnologia.layar.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(schema="poi", name="anchor")
@SequenceGenerator(sequenceName="poi.anchor_id_seq" , name="anchor_seq")
public class Anchor implements Serializable{
	private Long id;
	private Geolocation geolocation;
	private String referenceImage;
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="anchor_seq")
	@Column(name="id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="geolocation")
	public Geolocation getGeolocation() {
		return geolocation;
	}
	public void setGeolocation(Geolocation geolocation) {
		this.geolocation = geolocation;
	}
	
	@Column(name="reference_image")
	public String getReferenceImage() {
		return referenceImage;
	}
	public void setReferenceImage(String referenceImage) {
		this.referenceImage = referenceImage;
	}
	
}
